<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://cdn.bootcss.com/jquery/1.11.3/jquery.js"></script>
    <!-- 官网 http://www.trentrichardson.com/jsonsql/ -->
    <script src="jsonsql-0.1.js"></script>
</head>
<span id="test">现金</span>
<body>
<script>
    // 数组测试
    var paylist = [
        {"id":"1","paymode": '1', "payname": "现金", "paymoney": "20"}
        , {"id":"3","paymode": '2', "payname": "支付宝", "paymoney": "50"}
        , {"id":"2","paymode": '1', "payname": "现金", "paymoney": "40"}
    ];

    //根据payname现金进行筛选
    var result1 = jsonsql.query('select * from paylist order by id desc',paylist);
    var result2 = jsonsql.query('select * from paylist where (payname=="现金") order by id desc',paylist);
    console.log(result1);
    console.log(result2);

    var paylist10 = {"id":"1","paymode": '1', "payname": "现金", "paymoney": "20"};
    var result10 = jsonsql.query('select * from paylist10',paylist10);
    console.log(result10);


</script>
</body>
</html>